package com.tianji.store.controller;


import com.tianji.common.Result;
import com.tianji.store.service.StoreService;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.ExecutionException;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 陈佳
 * @since 2024-10-14
 */
@RestController
@RequestMapping("/store")
@RequiredArgsConstructor
public class StoreController {

    private final StoreService storeService;

    @ApiOperation(value = "查询门店信息，异步保存历史记录")
    @GetMapping("/getStoreBYName")
    public Result getStoreByName(@RequestParam String name,
                                 @RequestParam Integer page,
                                 @RequestParam Integer pageSize) throws ExecutionException, InterruptedException {
        return storeService.getStoreByName(name,page,pageSize);
    }
}

